package vista;


import java.awt.image.BufferedImage;
import java.util.List;


import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.EtchedBorder;
/**
 * this class is the panel that control the suspects sheet
 * @author Jose Luis Garcia && Alvaro Blazquez Checa
 *
 */
public class SuspectsPanel extends JFrame  {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final BufferedImage imagenFondo, imagenMarcado;
	int tamX, tamY, imageHeight, imageWidth;
	private boolean[] descartados = new boolean[26];
	private List<JButton> botonera;
	
	private JPanel panelMarcados;
	private SuspectAreaFiller panel;
	/**
	 * this construct create the zone for the suspects sheet area
	 * @param imagenFondo the image of the suspects sheet
	 * @param imagenMarcado2 the image when a monk is selected
	 */

	public SuspectsPanel(final BufferedImage imagenFondo,final BufferedImage imagenMarcado2) {
		
		this.imagenFondo = imagenFondo;
		this.imagenMarcado = imagenMarcado2;
		tamX = imagenFondo.getWidth();
		tamY = imagenFondo.getHeight();
		cargaPropiedades(0, 0, tamX, tamY);
		panelMarcados = new JPanel();
		panelMarcados.setLayout(null);
		panelMarcados.setFont(null);

		panel = new SuspectAreaFiller(imagenMarcado2, imagenFondo);
		
		Border outsideBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
		Border insideBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
		
		panel.setBorder(BorderFactory.createCompoundBorder(outsideBorder, insideBorder));
		
		this.setAlwaysOnTop(true);
		this.setUndecorated(true);
		setContentPane(panel);
	}
	/**
	 * return the current panel
	 * @return
	 */
	public SuspectAreaFiller getPanel() {
		return panel;
	}

	/**
	 * this will create the properties for the panel
	 * @param locationX 
	 * @param locationY
	 * @param tamX
	 * @param tamY
	 */
	private void cargaPropiedades(int locationX, int locationY, int tamX,
			int tamY) {
		//this.addMouseMotionListener(this);
		//this.addMouseListener(this);
		setLayout(null);
		setBounds(locationX, locationY, imagenFondo.getWidth(),
				imagenFondo.getHeight());
	}

	
	/**
	 * this return the Height of the image 
	 * @return int 
	 */
	public int getImageHeight() {
		return imageHeight;
	}
	/**
	 * this set the Height of the image  
	 */
	public void setImageHeight(int imageHeight) {
		this.imageHeight = imageHeight;
	}
	/**
	 * this return the width of the image 
	 * @return int 
	 */
	public int getImageWidth() {
		return imageWidth;
	}
	/**
	 * this set the width of the image 
	 */
	public void setImageWidth(int imageWidth) {
		this.imageWidth = imageWidth;
	}
}
